﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Ctl_ctlFilterBar : System.Web.UI.UserControl
{

    public Func<string,bool> OnFindClik;
    public Func< bool> OnFilterListClik;
    public Func< bool> OnFilterSaveClik;
    

    protected void Page_Load(object sender, EventArgs e)
    {

    }

    public string HintServiceMethod { get { return AutoCompleteExtender1.ServiceMethod; } set { AutoCompleteExtender1.ServiceMethod = value; } }
    public string BtnAddFilter_ClientID { get { return btnAddFiltr.ClientID.Replace("_", "$"); } }
    public string BtnFilterList_ClientID { get { return btnFilterList.ClientID.Replace("_", "$"); } }
    

    public string Lexeme { get { return txtLexeme.Text; } set { txtLexeme.Text = value; } }
    
    protected void btnFind_Click(object sender, ImageClickEventArgs e)
    {
        if (null != OnFindClik)
            OnFindClik(txtLexeme.Text);

    }
    protected void btnFilterList_Click(object sender, ImageClickEventArgs e)
    {
        if (null != OnFilterListClik)
                OnFilterListClik();

    }
    protected void btnAddFiltr_Click(object sender, ImageClickEventArgs e)
    {
        if (null != OnFilterSaveClik)
                OnFilterSaveClik();
            
    }
    protected void btnReset_Click(object sender, ImageClickEventArgs e)
    {
        Lexeme = string.Empty;
        btnFind_Click(null, null);        
    
    }
}

